from tkinter import *


print("Введите координаты фигуры")
x = int(input("x="))
y = int(input("y="))
N = int(input("N="))

root = Tk()
root.title("ИТ марафон")
root.geometry("500x500")
canvas = Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)

canvas.create_rectangle(x, y, x+N*10, y+N*20, fill="black")
canvas.create_rectangle(x+N*10, y+N*10, x+N*20, y+N*30, fill="black")


if N == 0 and x >= 0 and x <= 500 and y >= 0 and y <= 500:
     pass
else:
     if N > 0 and 0 * N + x >= 0 and 0 * N + y >= 0 and 10 * N + x <= 500 and 20 * N + y <= 500:
         pass
     else:
          if N < 0 and 10 * N + x >= 0 and 10 * N + y >= 0 and 20 * N + x <= 500 and 30 * N + y <= 500:
              pass
          else:
               print("Вы ввели неправильные данные")
               exit()

root.mainloop()


